home *** CD-ROM | disk | FTP | other *** search
/ Day Cry / Day Cry CD.bin / oh_towns / taropyon / silib / silib.lzh / PRG / SDKFS / FSELDRV.C < prev    next >
C/C++ Source or Header  |  1993-11-20  |  2KB  |  102 lines

  1. /*************************************************************************
  2. *    âhâëâCâuÅεò±
  3. *************************************************************************/
  4.  
  5. #include    <stdio.h>
  6. #include    <stdlib.h>
  7. #include    <string.h>
  8. #include    <dos.h>
  9. #include    <msdos.cf>
  10.  
  11. #include    <silib.h>
  12. #include    <sipd.h>
  13. #include    <sifs.h>
  14. #include    <sicoltbl.h>
  15. #include    <FS/sysinf.h>
  16. #include    "sdkfs.h"
  17. #include    "sdkfscf.h"
  18.  
  19. #define    MAXDRV    (26)
  20.  
  21. static int        flgSet = FALSE;
  22. static int        DrvInf[MAXDRV];
  23.  
  24. static    int    is_drv(int drv)
  25. {
  26.     Registers.AX.R = 0x4409;    /* âhâëâCâuîƒì╕    */
  27.     Registers.BX.R = drv + 1;    /* âhâëâCâu        */
  28.     calldos();
  29.     return    (FS_chkErr() != NORMAL ? 0 : 1);
  30. }
  31.  
  32. /*************************************************************************
  33. *    âhâëâCâuÅεò±é╠ĵô╛
  34. *************************************************************************/
  35.  
  36. int        FileSel_getDrvinf( FILESEL_T *fs )
  37. {
  38.     int        drv;
  39.  
  40.     if ( !flgSet )
  41.     {
  42.         SYSINF_T    sysinf;
  43.  
  44.         for ( drv = 0; drv < MAXDRV; ++drv )
  45.             DrvInf[drv] = FALSE;
  46.         ESR_getSetup( &sysinf );
  47.         for ( drv = 0; drv < 16; ++drv )
  48.         {
  49.             if ( sysinf.drvinf[drv].drvTyp != 0xFF )
  50.                 DrvInf[drv] = TRUE;
  51.         }
  52.         DrvInf[(int)'Q'-'A'] = TRUE;    /* CD-ROM */
  53.         for ( drv = 0; drv < MAXDRV; ++drv )
  54.         {
  55.             if ( DrvInf[drv] == FALSE )
  56.             {
  57.                 if ( is_drv(drv) )
  58.                     DrvInf[drv] = TRUE;
  59.             }
  60.         }
  61.         flgSet = TRUE;
  62.     }
  63.  
  64.     return (NORMAL);
  65. }
  66.  
  67. /*************************************************************************
  68. *    âhâëâCâuÅεò±é╠ò\Ī
  69. *************************************************************************/
  70.  
  71. void    FileSel_dspDrv( FILESEL_T *fs )
  72. {
  73.     int        drv;
  74.     LAYER_T    *ly = SiScn->layerCrt;
  75.  
  76.     FileSel_getDrvinf( fs );
  77.     MOS_DEC();
  78.     for ( drv = 0; drv < MAXDRV; ++drv )
  79.     {
  80.         int        x, y;
  81.         COLOR_T    col;
  82.         char    tmp[4];
  83.  
  84.         x = fs->frDrv.x1 + (drv % (MAXDRV/2)) * (2+6+2);
  85.         y = fs->frDrv.y1 + (drv/(MAXDRV/2)) * (16);
  86.         SCN_BOXFCON(x,y,x+9,y+15,1,PSET,ly->col.gray,FSCOL_HIL,FSCOL_SHA);
  87.         if ( fs->drv == drv )
  88.             col = C_HRED;
  89.         else if ( DrvInf[drv] )
  90.             col = ly->col.black;
  91.         else
  92.             col = ly->col.white;
  93.         tmp[0] = 'A' + drv;
  94.         tmp[1] = '\0';
  95.         SCN_PUTS(SiFts->ftsSs2,tmp,x+2,y+2,OPAQUE,col,ly->col.gray);
  96.  
  97.         EV_SETBTN1(fs->evDrv,drv, drv, fs, fsEvFunc_chdrv,
  98.             NULL, EVSW_LEFT,x,y,x+9,y+15,1,FSCOL_HIL,FSCOL_SHA);
  99.     }
  100.     MOS_INC();
  101. }
  102.